package com.css.zfzx.fwsjcj.modules.structure.service;

import com.alibaba.fastjson.JSONObject;
import com.css.zfzx.fwsjcj.modules.analysis.vo.AnalysisQueryVo;
import com.css.zfzx.fwsjcj.modules.structure.entity.FwStructureFormEntity;
import com.css.zfzx.fwsjcj.modules.structure.vo.CheckVo;
import com.css.zfzx.fwsjcj.modules.structure.vo.StructureQueryVo;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author leon
 * @Title: FwStructureFormService
 * @Description: 房屋结构主表Service
 * @date 2020/6/2 15:28
 */
public interface FwStructureFormService {
    void save(FwStructureFormEntity fwStructureFormEntity);

    void update(FwStructureFormEntity fwStructureFormEntity);

    /**
     * 任务下分页
     */
    JSONObject getPage(StructureQueryVo structureQueryVo, int curPage, int pageSize);

    /**
     * 审核分页
     */
    JSONObject getCheckPage(StructureQueryVo structureQueryVo, int curPage, int pageSize);


    void delete(List<String> idList);

    FwStructureFormEntity findById(String id);

    /**
     * 根据子表类型和子表id,获取主表详情
     *
     * @param type
     * @param id
     * @return
     */
    FwStructureFormEntity findStructureForm(String type, String id);

    /**
     * 审核修改主表和子表
     *
     * @param id
     * @param checkVo
     */
    void check(String id, CheckVo checkVo);

    void check(CheckVo checkVo);

    /**
     * 提交修改主表和子表
     *
     * @param idList
     */
    void submit(List<String> idList);

    /**
     * 查询8种子表信息
     *
     * @param id
     * @return
     */
    Object getChild(String id);

    /**
     * 统计分析查询建筑名称list
     *
     * @param analysisQueryVo
     * @return
     */
    List<String> getBuildingNameList(AnalysisQueryVo analysisQueryVo);

    /**
     * 根据省市审批状态查询详查表单
     *
     * @param provice
     * @param city
     * @param spType
     * @return
     */
    List<FwStructureFormEntity> getFormList(String provice, String city, String area,String taskName, String spType);

    /**
     * 保存附件Id
     * @param formId
     * @param type
     * @param fileId
     * @return
     */
    String updateFile(String formId, String type, String fileId);
   /* *//**
     * 根据普查子表类型查询子表IDs
     *//*
    List<String> getIdsByStructureType(String structureType);

    *//**
     * 详查类型下数据是否为空
     *//*
    Boolean isEmpty(String type);

    *//**
     * 根据类型导出
     *//*
    void export(String type, HttpServletResponse response);*/



    /**
     * 根据普查子表类型查询子表IDs
     */
    List<String> getIdsByStructureType(StructureQueryVo structureQueryVo);

    /**
     * 详查类型下数据是否为空
     */
    Boolean isEmpty(StructureQueryVo StructureQueryVo);

    /**
     * 根据类型导出
     */
    void export(StructureQueryVo structureQueryVo, HttpServletResponse response);

    /**
     * 按类型结构统计栋数柱状图
     * @param analysisQueryVo
     * @return
     */
    Map<String, Object> findbuildCountMap(AnalysisQueryVo analysisQueryVo);

    /**
     * 按类型结构统计面积柱状图
     * @param analysisQueryVo
     * @return
     */
    Map<String, Object> findAreaCountMap(AnalysisQueryVo analysisQueryVo);

    /**
     * 按省为单位统计记录的房屋栋数
     * @param analysisQueryVo
     * @return
     */
    void exportForBuildingCount(StructureQueryVo structureQueryVo, HttpServletResponse response);

    /**
     * 按省为单位统计记录的房屋面积
     * @param analysisQueryVo
     * @return
     */
    void exportForBuildingArea(StructureQueryVo structureQueryVo, HttpServletResponse response);

    JSONObject getCheckForQgSiftPage(StructureQueryVo structureQueryVo, int curPage, int pageSize);

    /**
     * 对已审核的数据做退回操作
     * @param id
     * @param checkVo
     */
    void back(String id, CheckVo checkVo);

    /**
     * 批量退回
     * @param checkVo
     */
    void batchBack(CheckVo checkVo);

    List<FwStructureFormEntity> getFormByTaskId(String id);

    JSONObject checkForExpertSift(StructureQueryVo structureQueryVo, int curPage, int pageSize);

    Boolean expertIsEmpty(StructureQueryVo structureQueryVo);

    void expertExport(StructureQueryVo structureQueryVo, HttpServletResponse response);

    Long findCount(AnalysisQueryVo analysisQueryVo);

    Double findAreaCount(AnalysisQueryVo analysisQueryVo);

    Map<String,Integer> getBelongtoCount(String province,String city,String area);
}
